import React, { Component } from 'react'
import {ListBox} from '../../../components'
import { Modal } from 'antd';
import { fetchData } from '../../../components/AjaxConsumer'
export default class UserDataAuthManage extends Component {
    constructor(props) {
        super(props);
        //行操作列表
        this.rowOperation = [

        ];
        //header 操作列表
        this.headerOperation = [
            // {
            //     handleName: 'addWorkarea',
            //     showName: '新增',
            //     iconClass: 'plus'
            // },{
            //     handleName: 'edit',
            //     showName: '修改',
            //     iconClass: 'edit'
            // }
            // ,{
            //     handleName: 'delete',
            //     showName: '删除',
            //     iconClass: 'delete'
            // }
        ];
        //table列表展示列配置
        //showName、columnName 必有属性， columnWidth 可选，默认100, columnHidden: true 列隐藏
        this.tableColumn = {
            storageKey: 'ListUserDataAuthColumnConfig',
            data:[
                {
                    showName: '登录名',
                    columnName: 'loginName'
                },{
                    showName: '人员名称',
                    columnName: 'userName'
                },{
                    showName: '权限类型',
                    columnName: 'normalUserBuzType'
                },{
                    showName: '权限编码',
                    columnName: 'buzCode'
                }
            ]
        };
        //搜索属性配置
        this.searchComponentData = [
            {
                showName: '登录名',
                name:'loginName',
                type: 'input',
                url: null
            },{
                showName: '人员名称',
                name:'userName',
                type: 'input',
                url: null
            },{
                showName: '权限类型',
                name: 'normalUserBuzType',
                type: 'input'
            },{
                showName: '权限编码',
                name:'buzCode',
                type: 'input',
                url: null
            }
        ];

    }



    
    rowHandles = (strHandles, rowObj) => {
        // console.log("strHandles===ListResource=======", strHandles);
        // if (strHandles === 'edit') {
        //     this.editHandle(rowObj);
        // } else if (strHandles === 'delete') {
        //     this.deleteHandle(rowObj);
        // } else if (strHandles === 'addWorkarea') {
        //     this.addWorkareaHandle();
        // } else if (strHandles == 'assignUser') {
        //     this.assignFactoryUserHandle(rowObj);
        // }
    }
    render() {
        //当左侧隐藏时，列表宽度加上左侧的宽度，test commit
        //1、当前this.props.isHideLeft 是从页面组件containers/Main/main.js传过来
        //2、this.props.isHideLeft 最顶级赋值是在页面 containers/Main/main.js
        let isHideLeft = this.props.isHideLeft;

        return(
            <div>
                <ListBox
                    ref = 'UserDataAuthList'
                    title="数据权限查询"
                    isHideLeft={isHideLeft}
                    tableColumnData = {this.tableColumn}
                    searchComponentData={this.searchComponentData}
                    url = '/base/auth/data/list'
                    rowHandles={this.rowHandles}
                    rowOperation={this.rowOperation}
                    headerOperation={this.headerOperation}
                    isRowSingle = "true"
                />
            </div>
        )
    }
}
